<link rel="stylesheet" type="text/css" href="../skins/css/compose.css" />
<link rel="stylesheet" type="text/css" media="all" title="Style sheet" href="../skins/css/style_email.css" />
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="../tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="../js/ui.core.js"></script>
<script src="../js/core.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/ui.dialog.js"></script>
<script type="text/javascript" src="../js/mail.js"></script>
<script type="text/javascript" src="../js/xajax_core.js"></script>

<script type="text/javascript" charset="UTF-8">
/* <![CDATA[ */
window.setTimeout(
 function() {
  var scriptExists = false;
  try { if (xajax.isLoaded) scriptExists = true; }
  catch (e) {}
  if (!scriptExists) {
   alert("Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?\nURL: js/xajax_core.js");
  }
 }, 2000);
/* ]]> */
</script>
<script type="text/javascript">
  	xajax.callback.global.onRequest = function() {xajax.$('system-busy').style.display = 'block';}
  	xajax.callback.global.beforeResponseProcessing = function() {xajax.$('system-busy').style.display='none';}
  	/*hover for menu top*/
  	jQuery(function(){
  		var url_now = window.location.href;
  		//alert(clear_url);
  		var pattern = 'modules';
  		available = url_now.match(pattern);
  		if(available!=null){
  			var clear_url = url_now.replace('http://tamnguyen.gencrm.com/modules/','');
  			//alert(url_now.indexOf('modules',0));
  			s = clear_url.indexOf('\/',0);
  			module = clear_url.substr(0,s);
  			jQuery("#"+module).addClass("active");
  		}
  	})
  	var JSTRAN = {language:{"_LANGCODE":"vi","_YES":"Yes","_NO":"No","_OK":"\u0110\u1ed3ng \u00fd","_CANCEL":"H\u1ee7y b\u1ecf","_PLEASEWAIT":"Please Wait","_FETCHING":"Loading...","_TAKINGBACK":"Taking you back to where you were....","_US_LOGGEDOUT":"B\u1ea1n \u0111\u00e3 tho\u00e1t kh\u1ecfi h\u1ec7 th\u1ed1ng","_LOGOUT":"Logout","_SUBJECT":"Subject","_ADD":"Add","_EDIT":"Edit","_DELETE":"X\u00f3a","_CLOSE":"Close","_SUBMIT":"Submit","_NOPERM":"B\u1ea1n ch\u01b0a \u0111\u01b0\u1ee3c quy\u1ec1n truy c\u1eadp v\u00e0o khu v\u1ef1c n\u00e0y.","_ERRORS":"Errors","_SEARCH":"Search","_ALL":"All","_TITLE":"Title","_OPTIONS":"Options","_LOGIN":"User Login","_USERNAME":"Username: ","_PASSWORD":"Password: ","_SELECT":"Select","_IMAGE":"Image","_SEND":"Send","_ASCENDING":"Ascending order","_DESCENDING":"Descending order","_BACK":"Back","_CONFIRM":"X\u00e1c nh\u1eadn","_GENCRM_URL":"http:\/\/tamnguyen.gencrm.com","_ERROR_OCCURED":"C\u00f3 l\u1ed7i x\u1ea3y ra","_LOADING":"\u0110ang t\u1ea3i...","EMAIL_MOVED_TO_T":" email \u0111\u00e3 \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ebfn th\u01b0 \u0111\u00e3 x\u00f3a","SELECT_MS_EMPTY":"B\u1ea1n ch\u01b0a ch\u1ecdn email n\u00e0o","EMAIL_DELETE_PER":" email \u0111\u00e3 x\u00f3a v\u0129nh vi\u1ec5n","EMAIL_MOVE_TO_SPAM":" email \u0111\u00e3 chuy\u1ec3n \u0111\u1ebfn th\u01b0 m\u1ee5c spam.","SURE_DEL_DIR":"B\u1ea1n c\u00f3 mu\u1ed1n x\u00f3a th\u01b0 m\u1ee5c n\u00e0y?","EMAILNOSPAM_MOVE_TO_INBOX":" cu\u00f4\u0323c h\u1ed9i tho\u1ea1i \u0111\u00e3 \u0111\u01b0\u1ee3c b\u1ecf \u0111\u00e1nh d\u1ea5u l\u00e0 spam v\u00e0 \u0111\u01b0\u1ee3c chuy\u1ec3n v\u00e0o H\u1ed9p th\u01b0 \u0111\u1ebfn.","DETECTED_MS":"Ki\u1ec3m tra th\u01b0 m\u1edbi","IN_BOX":"H\u1ed9p th\u01b0 \u0111\u1ebfn","UNCHECK_EVRYONE":"B\u1ea1n ch\u01b0a ch\u1ecdn th\u01b0 n\u00e0o","SURE_DEL":"B\u1ea1n c\u00f3 mu\u1ed1n x\u00f3a","DIR_NAME_NOT_EMPTY":"T\u00ean th\u01b0 m\u1ee5c kh\u00f4ng \u0111\u1ec3 tr\u1ed1ng!","EMAIL_MOVE_TO_R":"C\u00e1c th\u01b0 trong th\u01b0 m\u1ee5c \u0111\u00e3 \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ebfn h\u1ed9p th\u01b0 \u0111\u1ebfn.","_MAIL_CHECK_NEW_MAIL":"Ki\u1ec3m tra th\u01b0 m\u1edbi","_MAIL_NEW_MESSAGE_NUMBER_ALERT":"th\u01b0 m\u1edbi","_MAIL_NEW_MESSAGE_CHECKING":"\u0110ang ki\u1ec3m tra...","ERROR":"L\u1ed7i","CHANGE_NAME_DIR":"\u0110\u1ed5i t\u00ean th\u01b0 m\u1ee5c","CREAT_NEW_DIR":"T\u1ea1o m\u1edbi th\u01b0 m\u1ee5c","DIR_MANAGE":"Qu\u1ea3n l\u00fd th\u01b0 m\u1ee5c","_MAILTO_NOT_NULL":"Mail ng\u01b0\u1eddi nh\u1eadn kh\u00f4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng","_TITLE_NOT_NULL":"Ti\u00eau \u0111\u1ec1 kh\u00f4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng","_ATTACH_OTHER_FILE":"\u0110\u00ednh k\u00e8m 1 t\u1ec7p kh\u00e1c","_SENDING":"\u0110ang g\u1eedi...","_DANG_LUU":"\u0110ang l\u01b0u...","_MAIL_ERROR_FORMAT":"Kh\u00f4ng nh\u1eadn d\u1ea1ng \u0111\u01b0\u1ee3c \u0111\u1ecba ch\u1ec9 ","_MAIL_ERROR_FORMAT2":" trong tr\u01b0\u1eddng ","_MAIL_ERROR_FORMAT3":". Vui l\u00f2ng \u0111\u1ea3m b\u1ea3o r\u1eb1ng t\u1ea5t c\u1ea3 c\u00e1c \u0111\u1ecba ch\u1ec9 \u0111\u01b0\u1ee3c \u0111\u1ecbnh d\u1ea1ng \u0111\u00fang.","EMAIL_EMPTY":"B\u1ea1n ch\u01b0a ch\u1ecdn \u0111\u1ecba ch\u1ec9 email.","_SELECT_TEMPLATE":"Ch\u1ecdn th\u01b0 m\u1eabu","GENCRM_URL":"http:\/\/tamnguyen.gencrm.com","_MAIL_TEMPLATE_NEED_SYNC":"C\u1ea7n \u0111\u1ed3ng b\u1ed9 th\u01b0 m\u1eabu c\u01a1 s\u1edf tr\u01b0\u1edbc khi s\u1eed d\u1ee5ng","_MAIL_TEMPLATE_SYNC_DONE":"\u0110\u00e3 \u0111\u1ed3ng b\u1ed9 xong!","_MAIL_REFUSED_1":"V\u00e0o \u0111\u00e2y","_MAIL_REFUSED_2":"n\u1ebfu {danh_xung} kh\u00f4ng mu\u1ed1n ti\u1ebfp t\u1ee5c nh\u1eadn th\u01b0!","SELECT_CONTACT":"Ch\u1ecdn danh b\u1ea1","_MAIL_ON_ALL_BOOLS":"To\u00e0n b\u1ed9 c\u00e1c danh b\u1ea1","MAIL_ADD":"\u0110\u1ecba ch\u1ec9 email","_KEYWORD":"T\u1eeb kh\u00f3a"}}
</script> 

<script type="text/javascript">						
						tinyMCE.init({
							entity_encoding : "raw",
							mode : "exact",
							elements : "txtnoidung",
							theme : "advanced",
							width : "1085",
							height : "300", 
							plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,",

						
							theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect,undo,redo,|,link,unlink,image,forecolor,backcolor,pasteword",
							theme_advanced_buttons2 : "",
							theme_advanced_buttons3 : "",
							theme_advanced_buttons4 : "",
							theme_advanced_toolbar_location : "top",
							theme_advanced_toolbar_align : "left",							
							theme_advanced_resizing : false,
							
							content_css : "css/content.css",

							template_external_list_url : "lists/template_list.js",
							external_link_list_url : "lists/link_list.js",
							external_image_list_url : "lists/image_list.js",
							media_external_list_url : "lists/media_list.js",

							
							style_formats : [
								{title : 'Bold text', inline : 'b'},
								{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
								{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
								{title : 'Example 1', inline : 'span', classes : 'example1'},
								{title : 'Example 2', inline : 'span', classes : 'example2'},
								{title : 'Table styles'},
								{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
							],

							
							template_replace_values : {
								username : "Some User",
								staffid : "991234"
							}
						});
</script>
<div class="fN">
	<form id="CmailForm" name="CmailForm" method="POST" action="" enctype="multipart/form-data">
	<div style="width: 98%;padding:5px 5px;">
		<div style="line-height: 25px;" class="gr-btn-hd">
			<div onclick="sendmail();" role="button" class="bt-g">Gửi</div>
			
			<div onclick="cancelmail();" id="cancel" role="button" class="bt-g">Hủy bỏ</div>
			<div onclick="previewMail();" role="button" class="bt-g" style="background: -moz-linear-gradient(center top , rgb(249, 249, 249), rgb(227, 227, 227)) repeat scroll 0% 0% transparent;">Xem trước khi gửi</div>
			<div style="float: left" id="timedrafts"></div>
		</div>
	</div>
	<div style="padding: 0;width: 100%;  border-collapse: collapse;">
		<div class="row_repose"><div class="left_compose">Gửi từ:</div><div class="right_compose">
		<select style="width:300px;" id="sendfrom" name="sendfrom" onchange="MAIL_COMPOSE.getSignature(this.value);">
						<option selected="selected" value="1">tu@tamnguyen.vn</option>
					</select></div></div>
		<div class="row_repose">
			<div class="left_compose">Tới:</div>
			<div class="right_compose">
				<!--
					<textarea tabindex="1" autocomplete="off" onkeyup="SearchSugges(event,'to');" dir="ltr" tabindex="1" spellcheck="false" class="dK nr" style="width:100%;" id="to_addresses" name="to_addresses" aria-haspopup="true" value=""></textarea>  
				-->
				<textarea value="" aria-haspopup="true" name="to_addresses" id="to_addresses" style="width:100%;" class="dK nr" spellcheck="false" dir="ltr" autocomplete="off" tabindex="1"></textarea>
				<div id="divcc" style="float:left;">
					<div id="ccbcc" style="">
						<a style="font-size:11px;color:#0070BA;height:23px;" id="inv_cc" onclick="addCC();" href="javascript:void(0)"><span style="text-decoration: underline;">Thêm Cc</span>&nbsp;<span>|</span>&nbsp;</a>
						<a style="text-decoration: underline;font-size:11px;color:#0070BA;" id="inv_bcc" onclick="addBCC();" href="javascript:void(0)">Thêm Bcc</a>
					</div>
				</div>
				<a onclick="MAIL.v_fShowContactPupup();" href="javascript: void(0);" class="under" style="float: right;margin-left:5px; padding-top: 3px;">&nbsp;Chọn email</a>
				<span class="under" style="float: right; padding-top: 3px;"> | </span>
				<a class="under" style="float: right; cursor:pointer; margin-right:5px;"><img src="http://tamnguyen.gencrm.com/images/icons/Clear.gif" onclick="$('#to_addresses').val('');" title="Xóa"> </a>
				<div style="display: none;left: auto;top: 44px;" class="s-mail-sg" id="ss-to-add">
					<div class="s-mail-res" id="ss-to-add-s"></div>
				</div>
			</div>
		</div>
		<div id="to_cc" style="clear:both;display: none" class="row_repose">
			<div class="left_compose">Cc:</div>
			<div class="right_compose">
				<textarea aria-haspopup="true" name="cc_addresses" id="cc_addresses" class="dK nr" spellcheck="false" dir="ltr" tabindex="3"></textarea>
				<div style="display: none;left: auto;top: 44px;" class="s-mail-sg" id="ss-cc-add">
					<div class="s-mail-res" id="ss-cc-add-s"></div>
				</div> 
			</div>
		</div>
		
		<div id="to_bcc" style="height: 40px;clear: both;padding-bottom:4px;display: none" class="row_repose">
			<div class="left_compose">Bcc:</div>
			<div class="right_compose">
				<textarea aria-haspopup="true" name="bb_addresses" id="bb_addresses" class="dK nr" spellcheck="false" dir="ltr" tabindex="4"></textarea>
				<div style="display: none;left: auto;top: 44px;" class="s-mail-sg" id="ss-bb-add">
					<div class="s-mail-res" id="ss-bb-add-s"></div>
				</div> 
			</div>
		</div>
		<div class="row_repose">
			<div class="left_compose">Chủ đề:</div>
			<div class="right_compose">
				<input type="text" value="" id="Tieu_De" name="Tieu_De" style="width: 100%;height: 20px;" tabindex="2"> 
			</div>
		</div>
		<div class="row_repose">
			<div class="left_compose"></div>
			<div class="right_compose">
				<span id="link_upload" style="display:block;float:left;"><a class="under" href="javascript:void(0);" onclick="attachfile();">Đính kèm</a></span>
				<span style="float:left;margin-left: 5px;">&nbsp;
				</span>
				<span style="display:block;float:left;" id="link_upload"></span>
				<div style="clear: both;text-align:left;height:auto;padding-top:-5px;" class="row1" id="selectedfile"></div>
				<div style="clear: both" id="file_dk">
				</div>
				<div id="upload"></div>
				<div id="fileadddk"></div>
				<div style="text-align:left;margin-left:7px;display:none;clear:both" id="file_up" class="row1">File đã upload</div>
				<div style="margin-left:33px;text-align:left;height:auto;padding-top:-5px;" class="row1" id="uploadedfile"></div>
			</div>
		</div>
		
		<div class="row_repose">
			<div style="width: 1%" class="left_compose">
			</div>
			<div style="width: 96%; float: left" id="editortn">
				<textarea class="tinymce" style="width: 100%; display: none;" cols="80" rows="25" name="elm1" id="elm1" aria-hidden="true">										
									</textarea>
			</div>
			
			<div  id="edt-full" class="right_compose">
				<div id="editor-f">
				<textarea name="brief" id="txtnoidung" rows="15" cols="80"></textarea>  
				</div>
			</div>
            
		</div>
        
		<div class="row_repose">
			<div class="left_compose"></div>
		</div>
	</div>
	<div style="padding-left:5px;padding-top:15px;!important;" class="row_repose">
		<div class="gr-btn-hd">
			<div onclick="sendmail();" role="button" class="bt-g">Gửi</div>
			<!-- comment by tuan.vu at 2012-07-11 14:15
			<div class="bt-g" role='button' onclick="Drafts.save();" >Lưu bây giờ</div>
			-->
			<div onclick="cancelmail();" role="button" class="bt-g">Hủy bỏ</div>
			<div onclick="previewMail();" role="button" class="bt-g">Xem trước khi gửi</div>
		</div>
	</div>
	<input type="hidden" value="1" name="data_type" id="data_type">
	<input type="hidden" value="" name="arr_ids" id="arr_ids">
	<input type="hidden" value="" name="arremail" id="arr_email">
	<input type="hidden" value="0" id="isnew" name="isnew">
	<input type="hidden" value="0" id="autosave" name="autosave">
	<div style="display: none;" id="signature"><div style="text-align: left; ">--<br>Ok chữ ký</div></div>
	</form>
</div>